package demo12;

import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

/**
 * @description: 人员代理类
 * @author: apple
 * @date:  2022/2/3 9:12 下午
 * @version 1.0
 **/
@Component
@Aspect
public class PersonProxy {

    // 抽取相同的切入点
    @Pointcut("execution(* demo12.Person.add(..))")
    public void point() {
    }

    // 引用切入点
    @Before("point()")
    public void before() {
        System.out.println("before....");
    }

    // 引用切入点
    @After("point()")
    public void after() {
        System.out.println("after...");
    }
}
